package com.jwtsecurity.system.serivce.impl;

import com.jwtsecurity.system.dao.UserinfoDao;
import com.jwtsecurity.system.entity.Userinfo;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import com.jwtsecurity.system.serivce.UserinfoService ;

import javax.annotation.Resource;

@Service
public class UserinfoServiceImpl implements UserinfoService{

    @Resource
    private UserinfoDao dao;

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
       Userinfo userinfo =  dao.selectByPrimaryUsername(username);
        return userinfo;
    }
}
